package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 用户表
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private String userId;

    /**
     * 用户姓名--例如张三
     */
    private String userLoginName;

    /**
     * 登录用户名
     */
    private String userName;

    /**
     * 登陆密码
     */
    private String userPassword;

    /**
     * 职位
     */
    private String userPosition;

    /**
     * 电子邮箱
     */
    private String userEmail;

    /**
     * 手机号码
     */
    private String userPhonenum;

    /**
     * 是否为管理者 0==管理者 1==员工
     */
    private Byte userRoleId;

    /**
     * 状态，0：正常，1：删除，2封禁
     */
    private Byte userStatus;

    /**
     * 用户描述信息
     */
    private String userRemark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private String token;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getUserLoginName() == null ? other.getUserLoginName() == null : this.getUserLoginName().equals(other.getUserLoginName()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getUserPassword() == null ? other.getUserPassword() == null : this.getUserPassword().equals(other.getUserPassword()))
            && (this.getUserPosition() == null ? other.getUserPosition() == null : this.getUserPosition().equals(other.getUserPosition()))
            && (this.getUserEmail() == null ? other.getUserEmail() == null : this.getUserEmail().equals(other.getUserEmail()))
            && (this.getUserPhonenum() == null ? other.getUserPhonenum() == null : this.getUserPhonenum().equals(other.getUserPhonenum()))
            && (this.getUserRoleId() == null ? other.getUserRoleId() == null : this.getUserRoleId().equals(other.getUserRoleId()))
            && (this.getUserStatus() == null ? other.getUserStatus() == null : this.getUserStatus().equals(other.getUserStatus()))
            && (this.getUserRemark() == null ? other.getUserRemark() == null : this.getUserRemark().equals(other.getUserRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getUserLoginName() == null) ? 0 : getUserLoginName().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getUserPassword() == null) ? 0 : getUserPassword().hashCode());
        result = prime * result + ((getUserPosition() == null) ? 0 : getUserPosition().hashCode());
        result = prime * result + ((getUserEmail() == null) ? 0 : getUserEmail().hashCode());
        result = prime * result + ((getUserPhonenum() == null) ? 0 : getUserPhonenum().hashCode());
        result = prime * result + ((getUserRoleId() == null) ? 0 : getUserRoleId().hashCode());
        result = prime * result + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode());
        result = prime * result + ((getUserRemark() == null) ? 0 : getUserRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", userLoginName=").append(userLoginName);
        sb.append(", userName=").append(userName);
        sb.append(", userPassword=").append(userPassword);
        sb.append(", userPosition=").append(userPosition);
        sb.append(", userEmail=").append(userEmail);
        sb.append(", userPhonenum=").append(userPhonenum);
        sb.append(", userRoleId=").append(userRoleId);
        sb.append(", userStatus=").append(userStatus);
        sb.append(", userRemark=").append(userRemark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}